var Sai = function () {
    /*this.layout = new Sai.Layout();*/
    $(".form-table > table").tablesorter();
}
Sai.fn = Sai.prototype

Sai.Layout = function () {
    this.topMenu    = $("#top-menu");
    this.leftMenu   = $("#left-menu");
    this.module     = $("#module");
    
    $(window).resize($.proxy(this.onWindowResize, this));
    $(window).load($.proxy(this.onWindowResize, this));
    this.onWindowResize();
}
Sai.Layout.fn = Sai.Layout.prototype

Sai.Layout.fn.onWindowResize = function (event){
    var height = $(window).height() - this.topMenu.height() - 3;
    var width = $(window).width() - 230;
    
    this.leftMenu.height(height);
    this.module.height(height);
    this.module.width(width);
}

var SAI;

$(document).ready(function() {
    SAI = new Sai();
});